package com.zzb.projectfactory.framework.autodoc.document;

import com.zzb.projectfactory.framework.autodoc.document.impl.JsonCreateDocumentImpl;
import com.zzb.projectfactory.framework.autodoc.document.impl.MarkdownCreateDocumentImpl;
import com.zzb.projectfactory.framework.autodoc.document.impl.PdfCreateDocumentImpl;

/**
 * 创建文档的工厂类
 * Created by zhangzhenbin on 2017/2/13.
 */
public class CreateDocumentFactory {
    /**
     * 生产创建文档
     * @param type
     * @return
     */
    public static AbstractCreateDocument build(String type){
        if("pdf".equals(type)){
            return new PdfCreateDocumentImpl();
        } else if ("md".equals(type)){
            return new MarkdownCreateDocumentImpl();
        } else if("json".equals(type)){
            return new JsonCreateDocumentImpl();
        }
        return new MarkdownCreateDocumentImpl();
    }
}
